<?php

namespace Data;

class AccountGroup extends Base {

    public function getGroupList() {
        $result = $this->findAll();
        return $result;
    }

    public function updateGroupRoles($groupId, $roles) {
        $condition = array(
            'AccountGroupId' => $groupId,
        );
        $data = array(
            'Roles' => implode(',', $roles),
        );
        $this->where($condition)->update($data);
    }

}